var interval;

function startSecond() {

    interval = window.setInterval("changeSecond()", 1000);

};

function changeSecond() {
    var second = document.getElementById("second");

    var svalue = second.innerHTML;

    svalue = svalue - 1;

    if (svalue == 0) {
        window.clearInterval(interval);
        location.href = "../index.jsp";
        return;
    }

    second.innerHTML = svalue;
}

//获取XMLHttpRequest对象
function getXMLHttpRequest() {
    var xmlhttp;
    if (window.XMLHttpRequest) {// code for all new browsers
        xmlhttp = new XMLHttpRequest();
    } else if (window.ActiveXObject) {// code for IE5 and IE6
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }

    return xmlhttp;

}